export interface DictObj {
  parent: string
  name: string
  value: string
}
/**
 * 训练集中英文对照字典
 */
export const trainingSetDict: Record<string, DictObj> = {
  animal: {
    parent: '',
    name: '动物',
    value: 'animal'
  },
  cat: {
    parent: '动物',
    name: '猫',
    value: 'cat'
  },
  bird: {
    parent: '动物',
    name: '鸟',
    value: 'bird'
  },
  dog: {
    parent: '动物',
    name: '狗',
    value: 'dog'
  },
  sheep: {
    parent: '动物',
    name: '羊',
    value: 'sheep'
  },
  elephant: {
    parent: '动物',
    name: '大象',
    value: 'elephant'
  },
  horse: {
    parent: '动物',
    name: '马',
    value: 'horse'
  },
  cattle: {
    parent: '动物',
    name: '牛',
    value: 'cattle'
  },
  flower: {
    parent: '',
    name: '花',
    value: 'flower'
  },
  dandelion: {
    parent: '花',
    name: '蒲公英',
    value: 'dandelion'
  },
  roses: {
    parent: '花',
    name: '玫瑰',
    value: 'roses'
  },
  sunflowers: {
    parent: '花',
    name: '向日葵',
    value: 'sunflowers'
  },
  tulips: {
    parent: '花',
    name: '郁金香',
    value: 'tulips'
  },
  transportation: {
    parent: '',
    name: '交通工具',
    value: 'transportation'
  },
  bicycle: {
    parent: '交通工具',
    name: '自行车',
    value: 'bicycle'
  },
  car: {
    parent: '交通工具',
    name: '汽车',
    value: 'car'
  },
  bus: {
    parent: '交通工具',
    name: '客车',
    value: 'bus'
  },

  truck: {
    parent: '交通工具',
    name: '货车',
    value: 'truck'
  },
  motorbike: {
    parent: '交通工具',
    name: '摩托车',
    value: 'motorbike'
  },
  fruit: {
    parent: '',
    name: '水果',
    value: 'fruit'
  },
  apple: {
    parent: '水果',
    name: '苹果',
    value: 'apple'
  },
  orange: {
    parent: '水果',
    name: '橙子',
    value: 'orange'
  },
  banana: {
    parent: '水果',
    name: '香蕉',
    value: 'banana'
  }
}

/**
 * 任务类型下拉选项
 */
export const taskTypeList = [
  {
    label: '图像/图像分类',
    value: 1,
    modelList: ['efficientnet', 'mobilenet'],
    paramList: [
      {
        key: 'imgsz',
        value: 96
      },
      {
        key: 'lr',
        value: 0.001
      },
      {
        key: 'warm_up',
        value: 0
      },
      {
        key: 'epoch',
        value: 40
      },
      {
        key: 'batch_size',
        value: 32
      }
    ],
    trainingSet: [
      {
        title: trainingSetDict['animal'].name,
        key: 'd-animal', //d-代表需要过滤掉的数据
        children: [
          {
            title: trainingSetDict['cat'].name,
            key: 'cat'
          },
          {
            title: trainingSetDict['dog'].name,
            key: 'dog'
          },
          {
            title: trainingSetDict['sheep'].name,
            key: 'sheep'
          },
          {
            title: trainingSetDict['elephant'].name,
            key: 'elephant'
          },
          {
            title: trainingSetDict['horse'].name,
            key: 'horse'
          },
          {
            title: trainingSetDict['cattle'].name,
            key: 'cattle'
          }
        ]
      },
      {
        title: trainingSetDict['flower'].name,
        key: 'd-flower',
        children: [
          {
            title: trainingSetDict['dandelion'].name,
            key: 'dandelion'
          },
          {
            title: trainingSetDict['roses'].name,
            key: 'roses'
          },
          {
            title: trainingSetDict['sunflowers'].name,
            key: 'sunflowers'
          },
          {
            title: trainingSetDict['tulips'].name,
            key: 'tulips'
          }
        ]
      },
      {
        title: trainingSetDict['transportation'].name,
        key: 'd-transportation',
        children: [
          {
            title: trainingSetDict['bicycle'].name,
            key: 'bicycle'
          },
          {
            title: trainingSetDict['car'].name,
            key: 'car'
          },
          {
            title: trainingSetDict['bus'].name,
            key: 'bus'
          },
          {
            title: trainingSetDict['truck'].name,
            key: 'truck'
          },
          {
            title: trainingSetDict['motorbike'].name,
            key: 'motorbike'
          }
        ]
      }
    ]
  },
  {
    label: '图像/图像检测',
    value: 2,
    modelList: ['v8n', 'v5s'],
    paramList: [
      {
        key: 'epochs',
        value: 10
      },
      {
        key: 'imgsz',
        value: 640
      },
      {
        key: 'batch',
        value: 8
      }
    ],
    trainingSet: [
      {
        title: trainingSetDict['animal'].name,
        key: 'animal',
        children: [
          {
            title: `鸟`,
            key: `d-鸟`,
            disabled: true
          },
          {
            title: `猫`,
            key: `d-猫`,
            disabled: true
          },
          {
            title: `狗`,
            key: `d-狗`,
            disabled: true
          },
          {
            title: `马`,
            key: `d-马`,
            disabled: true
          },
          {
            title: `羊`,
            key: `d-羊`,
            disabled: true
          }
        ]
      },
      {
        title: trainingSetDict['fruit'].name,
        key: 'fruit',
        children: [
          {
            title: `苹果`,
            key: `d-苹果`,
            disabled: true
          },
          {
            title: `橙子`,
            key: `d-橙子`,
            disabled: true
          },
          {
            title: `香蕉`,
            key: `d-香蕉`,
            disabled: true
          }
        ]
      },
      {
        title: trainingSetDict['transportation'].name,
        key: 'transportation',
        children: [
          {
            title: `自行车`,
            key: `d-自行车`,
            disabled: true
          },
          {
            title: `汽车`,
            key: `d-汽车`,
            disabled: true
          },
          {
            title: `摩托车`,
            key: `d-摩托车`,
            disabled: true
          },
          {
            title: `客车`,
            key: `d-客车`,
            disabled: true
          }
        ]
      }
    ]
  }
]

/**
 * 训练状态下拉选项
 */
export const taskStatusList = [
  {
    label: '待训练',
    value: 1
  },
  {
    label: '训练中',
    value: 2
  },
  {
    label: '训练失败',
    value: 3
  },
  {
    label: '训练成功',
    value: 4
  },
  {
    label: '训练超时',
    value: 5
  }
]

/**
 * 服务状态下拉选项
 */
export const serviceStatusList = [
  {
    label: '未部署',
    value: 1
  },
  {
    label: '待部署',
    value: 2
  },
  {
    label: '部署中',
    value: 3
  },
  {
    label: '部署失败',
    value: 4
  },
  {
    label: '部署成功',
    value: 5
  },
  {
    label: '部署超时',
    value: 6
  },
  {
    label: '部署过期',
    value: 7
  }
]
